package com.mygdx.game.Scenes;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.mygdx.game.MyGdxGame;


public class Hud implements Disposable {
    public Stage stage;
    private Viewport viewport;
    public static Character_A character_a;
    public static ActiveCharacter activeCharacter;


    private  Integer worldTimer;
    private float timeCount;
    private Integer score;




    Label counrdownLabel;
    Label scoreLabel;
    Label timeLabel;
    Label levelLabel;
    Label worldLabel;
    Label marioLabel;

    public Hud (SpriteBatch sb ,float bodyX , float bodyY){
//        character_a = new Character_A(455,570);

        //activeCharacter = new ActiveCharacter("Character/Protagonist",bodyX,bodyY);



        worldTimer = 300;
        timeCount = 0;
        score = 0;

        viewport = new FitViewport(MyGdxGame.V_WIDTH,MyGdxGame.V_HEIGHT,new OrthographicCamera());
        stage = new Stage(viewport,sb);

        Table table = new Table();
        table.top();
        table.setFillParent(true);

        counrdownLabel = new Label(String.format("%03d",worldTimer),new Label.LabelStyle(new BitmapFont(), Color.WHITE));
        scoreLabel =new Label(String.format("%06d",score),new Label.LabelStyle(new BitmapFont(), Color.WHITE));
        timeLabel = new Label("300",new Label.LabelStyle(new BitmapFont(), Color.WHITE));
        worldLabel = new Label("1-1",new Label.LabelStyle(new BitmapFont(), Color.WHITE));
        marioLabel = new Label("Character",new Label.LabelStyle(new BitmapFont(), Color.WHITE));


        table.add(marioLabel).expandX().padTop(20);
        table.add(worldLabel).expandX().padTop(20);
        table.add(timeLabel).expandX().padTop(20);

          table.row();
//        table.add(scoreLabel).expandX();
//        table.add(levelLabel).expandX();
//        table.add(counrdownLabel).expand();
//        stage.getHeight();

        stage.addActor(table);
      //  stage.addActor(activeCharacter);


//        stage.addActor(character_a);

    }

    @Override
    public void dispose() {
        stage.dispose();
    }
}
